from langchain_core.messages import SystemMessage, HumanMessage
from langchain_core.output_parsers import StrOutputParser
from langchain_openai import ChatOpenAI

model = ChatOpenAI(model="deepseek-r1:14b", openai_api_key="ollama", openai_api_base="http://10.2.4.31:11434/v1/")

msg = [
    SystemMessage("请将以下内容翻译成英语"),
    HumanMessage("您好，怎么称呼您？")
]

result = model.invoke(msg)

parser = StrOutputParser()

print(parser.invoke(result))


